class Animal {
    public String name;
    public int age;
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal(String name, int age)");
    }

    public void eat() {
        System.out.println(this.name+"正在吃.....");
    }
}

class Dog extends Animal {
    public String color;

    public Dog(String name,int age,String color) {
        super(name,age);
        this.color = color;
        System.out.println("Dog(String name,int age,String color)");
    }
    public void barks() {
        System.out.println(this.name+" 正在叫.....");
    }

    public void eat() {
        System.out.println(this.name+" 正在吃狗粮......");
    }
}


public class Demo {
    public static void main(String[] args) {
        Animal animal = new Dog("旺财",2,"红色");
        animal.eat();
    }
    public static void main1(String[] args) {
        Dog dog = new Dog("旺财",2,"红色");
        dog.eat();
        dog.barks();

        Animal animal = new Animal("动物",3);
        animal.eat();
    }
}